package org.csmzxy.class2333;

//部门类
abstract class Department{
    String name;                //部门名称
    int numOfMenbers;           //部门人数
    public abstract void work();
}
//技术部门类
class TechDepartment extends Department{
    public TechDepartment(String name, int numOfMenbers){
        super.name = name;
        super.numOfMenbers = numOfMenbers;
    }
    @Override
    public void work(){
        System.out.println(super.name + "负责技术研发、软件开发和系统维护等，" + "部门有" + super.numOfMenbers + "人。");
    }
}
//销售部门类
class SaleDepartment extends Department{
    public SaleDepartment(String name, int numOfMenbers){
        super.name = name;
        super.numOfMenbers = numOfMenbers;
    }
    @Override
    public void work(){
        System.out.println(super.name + "负责技术研发、软件开发和系统维护等，" + "部门有" + super.numOfMenbers + "人。");
    }
}


public class Example09 {
    public static void main(String[] args){
        TechDepartment t = new TechDepartment("技术部门",50);
        t.work();
        SaleDepartment s = new SaleDepartment("销售部门",30);
        s.work();
    }
}
